import Vue from 'vue';
import VueRouter from 'vue-router';
// 确保组件路径正确
import CampusBinhai from '@/views/CampusBinhai.vue'; // 假设组件位于 views 文件夹下
import CampusChashan from '@/views/CampusChashan.vue'; // 假设组件位于 views 文件夹下
import CampusYueqing from '@/views/CampusYueqing.vue'; // 假设组件位于 views 文件夹下
import StudentSystem from '@/views/StudentSystem.vue'; // 假设组件位于 views 文件夹下
import Building5 from '@/views/Building5.vue'; // 假设组件位于 views 文件夹下
import Building6 from '@/views/Building6.vue'; // 假设组件位于 views 文件夹下
import Building7 from '@/views/Building7.vue'; // 假设组件位于 views 文件夹下

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'CampusBinhai',
    component: CampusBinhai
  },
  {
    path: '/chashan',
    name: 'CampusChashan',
    component: CampusChashan,
    children: [
      {
        path: 'building5',
        name: 'Building5',
        component: Building5
      },
      {
        path: 'building6',
        name: 'Building6',
        component: Building6
      },
      {
        path: 'building7',
        name: 'Building7',
        component: Building7
      }
    ]
  },
  {
    path: '/yueqing',
    name: 'CampusYueqing',
    component: CampusYueqing
  },
  {
    path: '/system',
    name: 'StudentSystem',
    component: StudentSystem
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router;